package com.itheima.chapter10.producerconsumer11;
//共享数据
public class Share {
    //定义一个标记，true表示允许消费者执行
    //            false表示允许生产者执行
    private static boolean flag ;
    //共享资源总数量
    private static int count ;
    //锁对象
    private static final Object lock =new Object();

    public Share() {
        this(false,10);
        //空参内部调用带参，对成员变量进行赋值
    }

    public Share(boolean flag, int count) {
        this.flag=flag;
        this.count =count;
    }

    public static boolean isFlag() {
        return flag;
    }

    public static void setFlag(boolean flag) {
        Share.flag = flag;
    }

    public static int getCount() {
        return count;
    }

    public static void setCount(int count) {
        Share.count = count;
    }

    public static Object getLock() {
        return lock;
    }


}
